#ifndef     MAINGRAPHIC_H
# define    MAINGRAPHIC_H

# include <SFML/Graphics.hpp>
# include <list>
# include <string>
# include "../ObjManager.hpp"
# include "../action.h"
# include "../vector.h"
# include "ImageManager.h"
# include "Camera.h"

class GameObject;

class MainGraphic
{
public:
    MainGraphic();
    ~MainGraphic() {}

    void Display();
    action & GetInput();
    sf::Image  * requireImage(std::string const & filename);
    sf::Sprite * requireSprite();
    void freeImage(std::string const & filename);
    void freeSprite(sf::Sprite * sprite);

    void Close()            { _app.Close(); }
    float GetElapsedTime()  { return _app.GetFrameTime(); }
    bool IsOpened()         { return _app.IsOpened(); }
    vector getImgSize(std::string const & img) { return _images.getImgSize(img); }
    void setTarget(vector * d) { _target = d; }

private:
    sf::RenderWindow        _app;
    ObjManager<sf::Sprite>  _spritePool;
    std::list<sf::Sprite*>  _sprites;
    action                  _act;
    ImageManager            _images;
    vector                * _target;
};

#endif   /* MAINGRAPHIC_H */
